package com.fc.mall.portal.wechat.dto;

import lombok.Getter;
import lombok.Setter;

/**
 * Created by Sunny on 2019/5/27.
 */
@Getter
@Setter
public class WxConfig {

    /**
     *   isUseWsp: 是否为微信服务商支付
     */
    private boolean isUseWsp;

    private boolean isDebug;

    private String appId;

    private String mchId;

    private String subAppId;

    private String subMchId;

    private String deviceInfo;

    private String notifyUrl;

    private String unifiedOrderUrl;

    private String tradeType;

    private String appSecrect;

    private String payKey ;

    private byte[] certData;

    public WxConfig()
    {
        this.deviceInfo = "WEB";
        this.unifiedOrderUrl = "https://api.mch.weixin.qq.com/pay/unifiedorder";
        this.tradeType = "JSAPI";
    }


    public WxConfig(String APP_ID,
                    String MCH_ID,
                    String SUB_APP_ID,
                    String SUB_MCH_ID,
                    String NOTIFY_URL,
                    String APP_SECRECT,
                    String PAY_KEY,
                    byte[] certData) {
        this.isUseWsp = true;
        this.appId = APP_ID;
        this.mchId = MCH_ID;
        this.subAppId = SUB_APP_ID;
        this.subMchId = SUB_MCH_ID;
        this.deviceInfo = "WEB";
        this.notifyUrl = NOTIFY_URL;
        this.unifiedOrderUrl = "https://api.mch.weixin.qq.com/pay/unifiedorder";
        this.tradeType = "JSAPI";
        this.appSecrect = APP_SECRECT;
        this.payKey = PAY_KEY;
        this.certData = certData;
        this.isDebug = isDebug;
    }

    public WxConfig(String APP_ID, String MCH_ID, String NOTIFY_URL, String APP_SECRECT, String PAY_KEY, byte[] certData) {
        this.isUseWsp = false;
        this.appId = APP_ID;
        this.mchId = MCH_ID;
        this.deviceInfo = "WEB";
        this.notifyUrl = NOTIFY_URL;
        this.unifiedOrderUrl = "https://api.mch.weixin.qq.com/pay/unifiedorder";
        this.tradeType = "JSAPI";
        this.appSecrect = APP_SECRECT;
        this.payKey = PAY_KEY;
        this.certData = certData;
    }
}
